package cn.sylinx.hbatis.ext.starter.pool;

public enum PoolType {

	Druid("com.alibaba.druid.pool.DruidDataSource"), TomcatJdbc("org.apache.tomcat.jdbc.pool.DataSource"), BoneCP(
			"com.jolbox.bonecp.BoneCPDataSource"), C3P0("com.mchange.v2.c3p0.ComboPooledDataSource"), Dbcp2(
					"org.apache.commons.dbcp2.BasicDataSource"), Dbcp("org.apache.commons.dbcp.BasicDataSource");

	private String className;

	private PoolType(String className) {
		this.className = className;
	}

	public String getClassName() {
		return className;
	}

	public static PoolType getPoolType(String poolTypeName) {

		PoolType[] dbts = PoolType.values();
		for (PoolType item : dbts) {
			if (item.name().equals(poolTypeName)) {
				return item;
			}
		}
		return null;
	}
}
